fix(doc): 修复title与搜索框文字无法垂直对齐的问题 - #298
Conversation
WalkthroughA CSS file in the documentation theme was updated to add two new style rules. These rules set the height property to Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/docs/fluent-editor/.vitepress/theme/style.css (1)
107-113: Validateheight: fit-contentsupport & provide graceful fall-backs
height: fit-contentis still classified as an experimental value for theheightproperty. While it works in the latest Chromium-based browsers, it is not consistently supported (or is buggy) in several Safari and older Firefox versions. A simple regression in those browsers will bring back the vertical-alignment issue.Consider adding a defensive fallback that will be honoured if the second declaration is ignored, and keep both selectors together to avoid duplication:
-.VPNavBarTitle .title > span { - height: fit-content; -} - -.DocSearch-Button-Placeholder { - height: fit-content; -} +.VPNavBarTitle .title > span, +.DocSearch-Button-Placeholder { + height: auto; /* graceful fallback */ + height: fit-content; /* preferred behaviour (modern UA) */ +}Optionally, add vendor-prefixed values (
-moz-fit-content,-webkit-fit-content) if you must target older engines.Please verify the visual result in Safari ≤15.* and Firefox ESR to ensure no regressions were introduced.
|
@GaoNeng-wWw 感谢发现并修复这个问题,这个问题确实很影响观感 |
|
@GaoNeng-wWw 我发现这个问题好像是这个PR引起的,这个PR设置了全局的样式
|
|
@all-contributors please add @GaoNeng-wWw for code. |
|
I've put up a pull request to add @GaoNeng-wWw! 🎉 |


PR
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit